//
//  WCISegmentView.h
//  WCImApp
//
//  Created by macMini on 2020/6/28.
//  Copyright © 2020 WCImApp. All rights reserved.
//

#import <UIKit/UIKit.h>

NS_ASSUME_NONNULL_BEGIN
@protocol MOSegmentViewDelegate <NSObject>
-(void)segmentViewWithSelectIndex:(NSInteger)index;
@end

@interface WCISegmentView : UIView
@property (nonatomic, weak) id<MOSegmentViewDelegate> delegate;
@property (nonatomic, strong) NSMutableArray *btnArray;
@property (nonatomic, strong) UIButton *lastBtn;
@property (nonatomic, assign) NSInteger currentIndex;
@property (nonatomic, strong) UIView *moveBgView;
/**  添加视图
* 设置好frame以后 或者 约束后  再调用该方法
* @param titleArray 题目数组
* @param delegate 代理
* @param index 初始默认
*/
- (WCISegmentView *)setSegmentTitleArray:(NSArray *)titleArray andDelegate:(id<MOSegmentViewDelegate>)delegate initIndex:(NSInteger)index;

//将某个按钮选中
- (void)setSegmentWithIndex:(NSInteger)index;
@end

NS_ASSUME_NONNULL_END
